package com.ruoyi.web.service;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.mapper.FoodMealsMapper;
import com.ruoyi.web.domain.FoodMeals;


/**
 * 菜品Service业务层处理
 *
 * @author xianpei
 * @date 2024-06-13
 */
@Service
public class FoodMealsService
{
    @Autowired
    private FoodMealsMapper foodMealsMapper;

    /**
     * 查询菜品
     *
     * @param mealsId 菜品主键
     * @return 菜品
     */

    public FoodMeals selectFoodMealsByMealsId(Long mealsId)
    {
        return foodMealsMapper.selectFoodMealsByMealsId(mealsId);
    }

    /**
     * 查询菜品列表
     *
     * @param foodMeals 菜品
     * @return 菜品
     */

    public List<FoodMeals> selectFoodMealsList(FoodMeals foodMeals)
    {
        return foodMealsMapper.selectFoodMealsList(foodMeals);
    }

    /**
     * 新增菜品
     *
     * @param foodMeals 菜品
     * @return 结果
     */

    public int insertFoodMeals(FoodMeals foodMeals)
    {
        foodMeals.setCreateTime(DateUtils.getNowDate());
        return foodMealsMapper.insertFoodMeals(foodMeals);
    }

    /**
     * 修改菜品
     *
     * @param foodMeals 菜品
     * @return 结果
     */

    public int updateFoodMeals(FoodMeals foodMeals)
    {
        return foodMealsMapper.updateFoodMeals(foodMeals);
    }

    /**
     * 批量删除菜品
     *
     * @param mealsIds 需要删除的菜品主键
     * @return 结果
     */

    public int deleteFoodMealsByMealsIds(Long[] mealsIds)
    {
        return foodMealsMapper.deleteFoodMealsByMealsIds(mealsIds);
    }

    /**
     * 删除菜品信息
     *
     * @param mealsId 菜品主键
     * @return 结果
     */

    public int deleteFoodMealsByMealsId(Long mealsId)
    {
        return foodMealsMapper.deleteFoodMealsByMealsId(mealsId);
    }
}
